﻿using AppSocketModel;
using BCGPSCommon;
using System.Collections.Generic;

namespace AppSocketService.Account
{
    public interface IAccountService
    {
        /// <summary>
        /// 获取全部账户 初始化REDIS用
        /// </summary>
        /// <returns></returns>
        List<AccountDto> InitRedisGetAll();
        /// <summary>
        /// 注册新账户
        /// </summary>
        /// <param name="accountRegisterDto"></param>
        /// <returns></returns>
        AccountDto RegisterNew(AccountRegisterDto accountRegisterDto);

        /// <summary>
        /// 账户登录
        /// </summary>
        /// <param name="accountLoginDto"></param>
        /// <param name="password"></param>
        /// <param name="ip"></param>
        /// <returns></returns>
        AccountDto Login(AccountLoginDto accountLoginDto, string ip);

        /// <summary>
        /// 修改账户信息
        /// </summary>
        /// <param name="accountDto"></param>
        /// <returns></returns>
        AccountDto Update(AccountDto accountDto);

        /// <summary>
        /// 修改账户密码
        /// </summary>
        /// <param name="accountId"></param>
        /// <param name="password"></param>
        void UpdatePassword(string accountId, string password);

        /// <summary>
        /// 添加子账户
        /// </summary>
        /// <param name="accountRequestDto"></param>
        /// <returns></returns>
        AccountDto AddNewSubAccount(AccountRequestDto   accountRequestDto);

        /// <summary>
        /// 获取当前登录用户信息
        /// </summary>
        /// <returns></returns>
        AccountDto GetCurrentAccount();

        /// <summary>
        /// 获取指定账户
        /// </summary>
        /// <param name="accountId"></param>
        /// <returns></returns>
        AccountDto GetAccount(string accountId);

        /// <summary>
        /// 获取子账户列表
        /// </summary>
        /// <returns></returns>
        List<AccountDto> GetSubAccountList(string accountId);



        /// <summary>
        /// 删除子账户
        /// </summary>
        /// <param name="accountId"></param>
        /// <returns></returns>
        bool DeleteSubAccount(string accountId);

        /// <summary>
        /// 获取全部用户列表
        /// </summary>
        /// <param name="companyId"></param>
        /// <param name="accountCode"></param>
        /// <param name="accountRole"></param>
        /// <param name="accountCodeType"></param>
        /// <param name="desc"></param>
        /// <param name="index"></param>
        /// <param name="size"></param>
        /// <returns></returns>
        PageableList<AccountDto> SystemGetAll(int? companyId, string accountCode, AccountRole? accountRole, AccountCodeType? accountCodeType, bool desc, int index, int size);

        /// <summary>
        /// 获取公司账户总数
        /// </summary>
        /// <param name="companyId"></param>
        /// <returns></returns>
        int GetCompanyAccountCount(int companyId);

        /// <summary>
        /// 获取全部子账户Id
        /// </summary>
        /// <param name="accountId"></param>
        /// <returns></returns>
        List<string> GetSubAccountIdAll(string accountId);

        /// <summary>
        /// 移动账号
        /// </summary>
        /// <param name="accountId"></param>
        /// <param name="parentAccountId"></param>
        /// <returns></returns>
        AccountDto MoveAccount(string accountId, string parentAccountId);
    }
}